﻿namespace Toggl.PhoneClient.Domain
{
    using Newtonsoft.Json;

    [JsonObject()]
    public class User
    {
        [JsonProperty(PropertyName = "id")]  
        public int Id { get; set; }

        [JsonProperty(PropertyName = "jquery_timeofday_format")]
        public string JQueryTimeFormat { get; set; }
        
        [JsonProperty(PropertyName = "api_token")]
        public string apiToken { get; set; }

        [JsonProperty(PropertyName = "jquery_date_format")]
        public string JqueryDateFormat { get; set; }

        [JsonProperty(PropertyName = "task_retention_days")]
        public int TaskRetentionDays { get; set; }

        [JsonProperty(PropertyName = "date_format")]
        public string DateFormat { get; set; }

        [JsonProperty(PropertyName = "default_workspace_id")]
        public int DefaultWorkspaceId { get; set; }

        [JsonProperty(PropertyName = "new_tasks_start_automatically")]
        public bool NewTasksStartAutomatically { get; set; }

        [JsonProperty(PropertyName = "fullname")]
        public string Fullname { get; set; }

        [JsonProperty(PropertyName = "language")]
        public string Language { get; set; }

        [JsonProperty(PropertyName = "beginning_of_week")]
        public int BeginningOfWeek { get; set; }

        [JsonProperty(PropertyName = "timeofday_format")]
        public string TimeOfDayFormat { get; set; }
        
        [JsonProperty(PropertyName = "email")]
        public string Email { get; set; }

        public override bool Equals(object obj)
        {
            return this.Id == (obj as User).Id;
        }
    }
}
